package stringOperation;

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        Number v = new Number();

        while(true){
            System.out.print("请输入身份证号：");
            v.id = input.next();
            System.out.print("请输入手机号：");
            v.mobile = input.next();
            System.out.print("请输入座机号：");
            v.landline = input.next();

            if (v.id.length() != 16 && v.id.length() != 18) {
                System.out.println("身份证号必须是16位或者为18位！");
                continue;
            }
            if (v.mobile.length() != 11) {
                System.out.println("手机号码必须是11位！");
                continue;
            }
            if (v.landline.indexOf("-") != 4 && v.landline.length() != 12) {
                System.out.println("区号必须为4位，电话号码为7位！");
                continue;
            }
            break;
        }
        System.out.println("注册成功！");
    }
}

